$(function() {
    //物流详情
    var skuId = tools.queryString().skuId;
    var token = localStorage.token;
    if (!token||!skuId) {
        location.href = "../loginAndReg/login.html";
        return false;
    };
    $.ajax({
        type: "get",
        url: domain.test + "/getlogistics",
        // url: domain.online + "/order/courier",
        data: {skuId:skuId},
        beforeSend: function (xhr) {
            xhr.setRequestHeader("token",token);
        },  
        success: function (response) {
            if(response.data.rtnCode===200) {
            // if(response.rtnCode===200) {
                var logisticsDetail = response.data.data;
                // var logisticsDetail = response.data;
                $(".logisticsDetail").html(template("logisticsDetail",{logisticsDetail:logisticsDetail}));
                $(".productPic").find("img").attr("src",localStorage.logisticsPic);
                var placeListHeight = $(".placeList").height();
                var placeItemPtop = parseFloat($(".placeItem").css("padding-top"));
                var lastPlaceItemHeight = $(".placeItem:last").height();
                var lineHeight = placeListHeight - (lastPlaceItemHeight + placeItemPtop);
                $(".line").height(lineHeight);
            }
            if (response.data.rtnCode === 401) {
            // if (response.rtnCode === 401) {
                var outTimeCode = response.data.rtnCode;
                // var outTimeCode = response.rtnCode;
                location.href = "../../index.html?outTimeCode=" + outTimeCode;
            }
        }
    });
});